﻿// =================================================================== 
// 项目说明
//====================================================================
// sushee @Copy Right 2019
// 文件： SmsTaskTimeStatsticsRepository.cs
// 项目名称：斑马车务
// 创建时间：2019/9/20
// 负责人：sushee
// ===================================================================
using System;
using System.Text;
using System.Collections.Generic;
using YouWei.Infrastructure.Entity;
using Dapper.Extensions;
using Dapper;

namespace YouWei.Infrastructure.Repository
{
	/// <summary>
	///任务周期统计 仓储层
	/// </summary>	
	public class SmsTaskTimeStatsticsRepository:BaseRepository<SmsTaskTimeStatstics>
	{		
    
        #region 构造

        public SmsTaskTimeStatsticsRepository() : base(){}

        public SmsTaskTimeStatsticsRepository(string connectionString) : base(connectionString){}

        public SmsTaskTimeStatsticsRepository(DatabaseContext dbContext) : base(dbContext){}

        #endregion

        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="condition"></param>
        /// <returns></returns>
        public Page<SmsTaskTimeStatstics> GetPages(int pageIndex, long pageSize, int taskTimeId)
        {
            string sql = "SELECT * FROM SmsTaskTimeStatstics WITH(NOLOCK) where TaskTimeID=@TaskTimeID";
            DynamicParameters dparams = new DynamicParameters();
            dparams.Add("@TaskTimeID", taskTimeId, System.Data.DbType.Int32);
            return dbContext.Connection.Page<SmsTaskTimeStatstics>(pageIndex, pageSize, sql.ToString(), dparams);
        }
    }
}